package org.ww.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.ww.common.utils.PageUtils;
import org.ww.member.dto.Oauth2WeiboDto;
import org.ww.member.dto.UserLoginDto;
import org.ww.member.dto.UserRegistDto;
import org.ww.member.entity.MemberEntity;
import org.ww.member.exception.PhoneExistException;
import org.ww.member.exception.UserNameExistException;

import java.util.Map;

/**
 * 会员
 *
 * @author ww
 * @email ww@qq.com
 * @date 2024-01-05 14:51:15
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void register(UserRegistDto dto);

    /**
     * 检查手机号是否重复
     * @param phone
     */
    void checkPhoneIsExist(String phone) throws PhoneExistException;

    /**
     * 检查用户名是否存在
     * @param userName
     */
    void checkUserNameIsExist(String userName) throws UserNameExistException;

    /**
     * 登录
     * @param dto
     * @return
     */
    MemberEntity login(UserLoginDto dto);

    /**
     * 社交登录：微博
     * @param dto
     * @return
     */
    MemberEntity login(Oauth2WeiboDto dto);
}

